package model

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Uuid      string `gorm:"column:uuid;type:varchar(36);unique" json:"uuid"`
	Name      string `gorm:"column:name;type:varchar(255);uniqueIndex" json:"name"`
	Password  string `gorm:"column:password;type:varchar(255);" json:"-"`
	Email     string `gorm:"column:mail;type:varchar(255);uniqueIndex" json:"mail"`
	Phone     string `gorm:"column:phone;type:varchar(255)" json:"phone"`
	Passnum   int    `gorm:"column:pass_num" json:"pass_num"`
	SubmitNum int    `gorm:"column:submit_num" json:"submit_num"`
	IsAdmin   int    `gorm:"column:is_admin;type:tinyint(1)" json:"is_admin"`
}

func (table *User) TableName() string {
	return "user"
}
